package buddhi.main.MyTour;

import java.util.ArrayList;

/**
 * @author Buddhiprabha
 *
 */

import java.util.List;

import buddhi.main.MyTour.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.Toast;

public class Main extends Activity {
	
	private List<String> prefer;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
    
    final Button button = (Button) findViewById(R.id.see_photoes);
    button.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
        	prefer =new ArrayList<String>();
        		CheckBox cb1 = (CheckBox) findViewById(R.id.check1);		//check if text boxes are selected
        		CheckBox cb2 = (CheckBox) findViewById(R.id.check2);
        		CheckBox cb3 = (CheckBox) findViewById(R.id.check3);
        	        if(cb1.isChecked()){
        	        	prefer.add("historical");							//add to interest list
        	        }
        	        if(cb2.isChecked()){
        	        	prefer.add("natural");								//add to interest list
        	        }
        	        if(cb3.isChecked()){
        	        	prefer.add("entertainment");						//add to interest list
        	        }
        	        if(prefer.size() != 0){
        	Intent i = new Intent("buddhi.main.MyTour.OPENGALLERY");
        	i.putStringArrayListExtra("preferences", (ArrayList<String>) prefer);
        	startActivity(i);
            Toast.makeText(Main.this, "Click on images to see them bigger.", Toast.LENGTH_SHORT).show();
        	        }else{
        	        	Toast.makeText(Main.this, "Please specify your interests to continue", Toast.LENGTH_SHORT).show();
        	        }
        }
    });
}}